Apple, the Apple logo, and Macintosh are registered trademarks of Apple Computer, Inc.
Mac and OpenDoc are trademarks of Apple Computer, Inc.
Introduction
The OpenDoc Arbitrator can be extended by developers, to handle additional focus types, perhaps associated with some exotic peripheral device. The same mechanism can also be used to “patch” the arbitrator. See also Patching OpenDoc.
Note: Most developers should not need to extend or patch the arbitrator. Please think very carefully before doing so.
A focus is simply an ISO standard string. CI Labs will presumably set up a process for registering new foci for public consumption. The OpenDoc APIs use tokenized forms of these strings (using ODSession::Tokenize()).
ODArbitrator maintains a dictionary of focus modules, with the tokenized focus as the key. The methods of ODArbitrator (like RequestFocusSet()) look up a focus module for each focus, and calls appropriate methods of the focus module.
To extend the Arbitrator, a developer must implement a subclass of ODFocusModule, and install it in the arbitrator.
Defining a Focus Module
ODFocusModule is a System Object Model™ (SOM) class, just like ODPart, and must be subclassed (in IDL). The subclass should have an Init<ClassName> method, and should override the methods below. The Init<ClassName> method should call InitFocusModule.
ODBoolean IsFocusExclusive(in ODTypeToken focus);
void SetFocusOwnership(in ODTypeToken focus, in ODFrame frame);
void UnsetFocusOwnership(in ODTypeToken focus, in ODFrame frame);
The class reference documentation describes the semantics of each method in detail, and the source code for OpenDoc's standard exclusive focus module is included with these recipes. See ExFocus.idl and ExFocus.cpp.
Installing a Focus Module
A focus module should be installed by calling ODArbitrator::RegisterFocus: